//
//  AXFFeeDetailCell.m
//  BEEQUICK
//
//  Created by HH on 16/11/24.
//  Copyright © 2016年 SevenGroup. All rights reserved.
//

#import "AXFFeeDetailCell.h"

@implementation AXFFeeDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI
{
    
    NSArray<NSString *> *nameArr = @[@"商品总额",@"配送费",@"服务费",@"优惠券"];
    
    NSMutableArray<UILabel *> *nameLabelArr = [NSMutableArray array];
    
    [nameArr enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        UILabel *label = [UILabel cz_labelWithText:obj fontSize:12 color:[UIColor lightGrayColor]];
        
        [nameLabelArr addObject:label];
        
        [self.contentView addSubview:label];
    }];
    
    [nameLabelArr mas_distributeViewsAlongAxis:MASAxisTypeVertical withFixedSpacing:8 leadSpacing:8 tailSpacing:8];
    
    [nameLabelArr mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(8);
        
        
    }];
    
    NSMutableArray <UILabel *> *priceLabelArray = [NSMutableArray array];
    
    NSArray <NSString *> *priceArray = @[@"¥44.5",@"¥5",@"¥0",@"¥0"];
    
    [priceArray enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        UILabel *priceLabel = [UILabel cz_labelWithText:obj fontSize:12 color:[UIColor lightGrayColor]];
        
        [priceLabelArray addObject:priceLabel];
        
        [self.contentView addSubview:priceLabel];
    }];
    
    [priceLabelArray mas_distributeViewsAlongAxis:MASAxisTypeVertical withFixedSpacing:8 leadSpacing:8 tailSpacing:8];
    [priceLabelArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-8);
    }];
    
    
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
